<?php

use Illuminate\Routing\Router;

Route::group([
    'prefix' => 'admin/confManager',
    'namespace' => 'Buu\\Modules\\ConfManager\\Controllers',
    'middleware' => [
        'web',
        'admin'
    ],
], function (Router $router) {
    // 配置管理列表
    $router->get('/index', 'ConfManagerController@index');

    // 编辑元配置
    $router->get('/edit_metaconf/{project_code}/', 'ConfManagerController@edit_metaconf');
    // 新建元配置
    $router->post('/save_metaconf', 'ConfManagerController@save_metaconf');
    // 保存元配置
    $router->post('/save_metaconf/{project_code}', 'ConfManagerController@save_metaconf');
    $router->post('/check_metaconf/{project_code}', 'ConfManagerController@check_metaconf');

    // 编辑配置数据
    $router->post('/{project_code}/check_conf', 'ConfManagerController@check_conf');

    //创建分群
    $router->get('/{project_code}/create_version', 'ConfManagerController@create_version');
    $router->post('/{project_code}/save_version_condition', 'ConfManagerController@save_version_condition');
    //编辑配置
    $router->get('/{project_code}/{version_id}/edit_conf', 'ConfManagerController@edit_conf');
    $router->post('/{project_code}/{version_id}/save_conf', 'ConfManagerController@save_conf');
    //编辑分群信息
    $router->get('/{project_code}/{version_id}/edit_version', 'ConfManagerController@edit_version');
    //删除版本
    $router->get('/{project_code}/{version_id}/del_version_confirm', 'ConfManagerController@del_version_confirm');
    $router->post('/{project_code}/{version_id}/del_version', 'ConfManagerController@del_version');
});